Promotion Articles
Frequency:
Promotion articles data changes are required to be sent in near real-time. Any change to the interface field in the external system should trigger the interface.
Expected data:
Article promotions data for specific purchase/sales dates on organization or store level.
Technical:
If a promotion articles record does not exist in DSOrder, the record will be created.
If a promotion articles record already exists in DSOrder, the existing record will be updated with the new data.
Get Promotion Articles
Method: GET
URL: https://{url}/promotions/articles/{date}/{store_id}
Retrieve promotion articles for a specific store and date.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | Date in format yyyy-mm-dd |
| store_id | string | Yes | Unique store identifier in external system |
Response Body
| Name | Type | Required | Description |
|---|---|---|---|
| article_id | string | Yes | Unique article identifier in external system |
| promotion_id | string | Yes | Unique promotion identifier in external system |
| purchase_start | date | Yes | Date when purchase period for promotion starts (in format: yyyy-mm-dd) |
| purchase_end | date | Yes | Date when purchase period for promotion ends (in format: yyyy-mm-dd) |
| sales_start | date | Yes | Date when sales period for promotion starts (in format: yyyy-mm-dd) |
| sales_end | date | Yes | Date when sales period for promotion ends (in format: yyyy-mm-dd) |
| is_not_ordered_after_promo | boolean | No | Indicates if purchase order should be placed outside promotion period. Only works for orders with delivery date within promo period. Default: false |
Response
200: OK
[
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00001",
"purchase_start": "2023-07-26",
"purchase_end": "2023-08-30",
"sales_start": "2023-08-01",
"sales_end": "2023-08-30",
"is_not_ordered_after_promo": false
},
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00002",
"purchase_start": "2023-07-26",
"purchase_end": "2023-08-30",
"sales_start": "2023-08-01",
"sales_end": "2023-08-30",
"is_not_ordered_after_promo": true
}
]
Import Promotion Articles
Method: POST
URL: https://{url}/promotions/articles
Create or update promotion articles.
Request Body
The request body is a JSON array of objects.
| Name | Type | Required | Description |
|---|---|---|---|
| promotion_id | string | Yes | Unique promotion identifier in external system |
| article_id | string | Yes | Unique article identifier in external system |
| store_id | string | No | Unique store identifier in external system (or null if promotion is not store specific) |
| purchase_start | date | Yes | Date when purchase period for promotion starts (in format: yyyy-mm-dd) |
| purchase_end | date | Yes | Date when purchase period for promotion ends (in format: yyyy-mm-dd) |
| sales_start | date | Yes | Date when sales period for promotion starts (in format: yyyy-mm-dd) |
| sales_end | date | Yes | Date when sales period for promotion ends (in format: yyyy-mm-dd) |
| is_not_ordered_after_promo | boolean | No | Indicates if purchase order should be placed outside promotion period. Only works for orders with delivery date within promo period. Default: false |
Request Example
[
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00001",
"store_id": null,
"purchase_start": "2023-07-26",
"purchase_end": "2023-08-30",
"sales_start": "2023-08-01",
"sales_end": "2023-08-30",
"is_not_ordered_after_promo": false
},
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00002",
"store_id": "STORE-0001",
"purchase_start": "2023-07-26",
"purchase_end": "2023-08-30",
"sales_start": "2023-08-01",
"sales_end": "2023-08-30",
"is_not_ordered_after_promo": true
}
]
Response
200: OK — Success
{
"success": true,
"message": null,
"data": null,
"warnings": []
}
200: OK — Error
{
"success": false,
"message": "Promotion article import failed",
"data": null,
"warnings": []
}
Delete Promotion Articles
Method: DELETE
URL: https://{url}/promotions/articles
Delete promotion articles from DSOrder.
Request Body
The request body is a JSON array of objects.
| Name | Type | Required | Description |
|---|---|---|---|
| promotion_id | string | Yes | Unique promotion identifier in external system |
| article_id | string | Yes | Unique article identifier in external system |
Request Example
[
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00001"
},
{
"promotion_id": "PROMOT-00001",
"article_id": "ART-00002"
}
]
Response
200: OK — Success
{
"success": true,
"message": null,
"data": null,
"warnings": []
}
200: OK — Error
{
"success": false,
"message": "Promotion article was not deleted",
"data": null,
"warnings": []
}